package com.niit.beans;

import java.util.List;
import java.util.Map;
import java.util.Set;

public class Student {
    private int id;
    private String name;
    private List<String> courses; // ArrayList
    private Set<String> books;    // HashSet/TreeSet
    private Map<String,Integer> marks; // HashMap, TreeMap

    public void setMarks(Map<String, Integer> marks) {
        this.marks = marks;
    }

    public void setBooks(Set<String> books) {
        this.books = books;
    }

    public void setCourses(List<String> courses) {
        this.courses = courses;
    }

    private University university;
    public void setId(int id) {
        this.id = id;
    }
    public void setName(String name) {
        this.name = name;
    }

    public void setUniversity(University university) {
        this.university = university;
    }
    public void showUniversity(){
        university.showInfo();
        System.out.println("ID: " + id+"Name: " + name);

        courses.forEach(course -> System.out.println(course));

        books.forEach(book -> System.out.println(book));

        Set<Map.Entry<String,Integer>> entrySet = marks.entrySet();
        entrySet.forEach(entry -> System.out.println(entry.getKey() + ":" + entry.getValue()));

        Set<String> keySet = marks.keySet();
        for(String key : keySet){
            System.out.println(key + ":" + marks.get(key));
        }
    }
}
